<script>
import {defineComponent} from 'vue'
import Home from "@/components/Home.vue";
import {computed} from "vue"

export default defineComponent({
  name: "App",
  components: {Home},
  data() {
    return {
      person: {id: 1, name: '陶品奇',}
    }
  },

  // provide:对象写法
  /*provide: {
    name: "陶品奇",
    age: 22,
  }
   */

  // provide:函数写法
  /*provide() {
    return {
      person: this.person
    }
  }
  */

// provide:函数写法 + 计算属性
  provide() {
    return {
      person: computed(() => {
        return this.person
      })
    }
  }

})
</script>

<template>
  <div class="app">
    <Home></Home>
  </div>
</template>

<style lang="less">

</style>
